package com.lianqi.emcpframework.dataaccess.configurer;

import javax.servlet.http.HttpSessionEvent;
import javax.servlet.http.HttpSessionListener;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.lianqi.emcpframework.dataaccess.DataAccessContextHolder;

/**
 * @program emcp-framework
 * @ClassName DataAccessSessionListener
 * @description: cas登出 数据权限 session监听
 * @author: sky
 * @create: 2019/08/07 16:33
 */

public class DataAccessSessionListener implements HttpSessionListener {

    Logger log = LoggerFactory.getLogger(DataAccessSessionListener.class);

    @Override
    public void sessionCreated(HttpSessionEvent se) {

    }

    @Override
    public void sessionDestroyed(HttpSessionEvent se) {
        log.info("-----清除当前session的数据权限数据---------");
        DataAccessContextHolder.remove(se.getSession().getId());
    }
}
